<template>
	<!-- 注意:在微信小程序中,组件中不允许使用标签选择器 -->
	<view class="go-top" @click="go">
		<uni-icons type="arrow-up" size="30"></uni-icons>
	</view>
</template>

<script>
	export default {
		name:"xzGoTop",
		data() {
			return {
				
			};
		},
		methods: {
			go() {
				//返回页面顶部
				uni.pageScrollTo({
					scrollTop:0,     //滚动到页面顶部的位置
					duration:200     //滚动动画耗时多久
				})
			}
		},
	}
</script>

<style lang="scss">
.go-top{
	position: fixed;
	right: $uni-spacing-row-base;
	bottom: $uni-spacing-col-lg * 7;
	background-color: #fff;
	border: $uni-border-width  $uni-border-style  $uni-border-color;
	box-shadow: 0 0 $uni-shadow-radius-base;
	border-radius: $uni-border-radius-circle;
	opacity: $uni-opacity-half;
	&:active{
		opacity: 1;
	}
}
</style>